package com.login.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.login.app.bean.User;
import com.login.app.dao.UserMapper;
import com.login.app.service.UserService;
import com.login.app.utils.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    /**
     *  登录
     * @param username 用户名
     * @param password 密码
     * @return 返回查询结果
     */
    @Override
    public User login(String username, String password) {
        QueryWrapper<User> wrapper = new QueryWrapper<>();
        wrapper.eq("user_name", username);
        wrapper.eq("user_password", password);
        return userMapper.selectOne(wrapper);
    }


//    /**
//     * 新增用户
//     * @param user 用户
//     * @return
//     */
//    @Override
//    public Integer insert(User user) {
//        return userMapper.insert(user);
//    }


}
